#include<stdio.h>
void reserve(char* a, int len)
{
    int left = 0, right = 0;
    right = len - 1;
    while (left < right)
    {
        int tmp = 0;
        tmp = a[left];
        a[left] = a[right];
        a[right] = tmp;
        right--;
        left++;
    }
}
int main()
{
    char a[100] = { 0 };
    gets(a);
    int len = strlen(a);
    reserve(a, len);
    char* start = a;
    char* end = a;
    while (*end != '\0')
    {
        while (*end != ' ' && *end != '\0')
        {
            end++;
        }
        reserve(start, (end - start));
        if (*end != '\0')
        {
            start = end + 1;
            end++;
        }

    }
    printf("%s", a);
    return 0;
}